package com.xydtech.busiflw.service;

import com.xydtech.busiflw.domain.BusiflInstance;
import com.xydtech.busiflw.domain.BusiflWaitTask;
import com.xydtech.common.core.domain.AjaxResult;
import com.xydtech.common.core.domain.entity.SysUser;
import com.xydtech.workflow.domain.WflFlowstep;

import java.util.List;

/**
 * 业务流程Service接口
 *
 * @author JHON
 * @date 2021-06-09
 */
public interface IBusinessFlowService {
    /**
     * 查询业务流程实例
     *
     * @param instanceId 业务流程实例ID
     * @return 业务流程实例
     */
    public BusiflInstance selectBusiflInstanceById(String instanceId);

    /**
     *初始化业务流程数据
     * @Title: initBusinessFlowData
     * @param wflFlowstep
     * @param flowId
     * @param instanceId
     * @param userId
     * @param deptId
     * @param keyInfo
     * @return BusiflWaitTask
     * @exception
     * @author JHON
     * @Date 2021/11/23 11:17
     **/
    BusiflWaitTask initBusinessFlowData(WflFlowstep wflFlowstep, Long flowId, String instanceId, Long userId, Long deptId, String keyInfo);

    /**
     *提交任务
     * @Title: submitTask
     * @param versionId
     * @param instanceId
     * @param stepId
     * @param taskId
     * @param keyInfo
     * @param approveType
     * @param approveMemo
     * @param user
     * @param choiceApproveUserList 任务多选时使用选择的审批人
     * @return com.xydtech.common.core.domain.AjaxResult
     * @exception
     * @author JHON
     * @Date 2021/11/29 10:39
     **/
    AjaxResult submitTask(Long versionId, String instanceId, Long stepId, Long taskId, String keyInfo, String approveType, String approveMemo, SysUser user, String choiceApproveUserList, String salt) throws Exception;

    /**
     *流程提交获取下一步骤节点信息
     * @Title: getNextStepInfo
     * @param versionId
     * @param orderNum
     * @param instanceId
     * @param keyInfo
     * @return com.xydtech.workflow.domain.WflFlowstep
     * @exception
     * @author JHON
     * @Date 2021/12/3 16:08
     **/
    WflFlowstep getNextStepInfo(Long versionId, Long orderNum, String instanceId, String keyInfo);

    /**
     *根据流程节点配置信息获取节点审批人
     * @Title: getApproveUserList
     * @param instanceId 业务实例
     * @param nextStep 下一流程节点
     * @param currentUser 当前用户
     * @param choiceApproveUserList 任务多选时使用选择的审批人
     * @return java.util.List<com.xydtech.common.core.domain.entity.SysUser>
     * @exception
     * @author JHON
     * @Date 2021/11/29 13:58
     **/
    List<SysUser> getApproveUserList(String instanceId, WflFlowstep nextStep, SysUser currentUser, String choiceApproveUserList, String salt);
}
